<?php
include "sql.php";
 $error="老弟，来取快递啦";
if(!empty( $_POST['xuehao'])){
$xuehao=$_POST['xuehao'];
$user=$con->query("select * from user where xuehao='{$xuehao}'");
if($user->num_rows==1){
    $res=array();
    foreach($user as $val){
        $res=$val;
    }
    setcookie("xuehao",$xuehao,time()+3600);
    echo "<script>window.location.href='index.php';</script>";
}else{
     $error="老弟，学号不太对哦";
}
}
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" type="text/css" href="css/detailsmusic.css" />
    <title>登录</title>
</head>
<body>
    <div class="music-lgin">

        <div class="music-lgin-all">
            <!--左手-->
            <div class="music-lgin-left ovhd">
                <div class="music-hand">
                    <div class="music-lgin-hara"></div>
                    <div class="music-lgin-hars"></div>
                </div>
            </div>

            <!--脑袋-->
            <div class="music-lgin-dh">
                <div class="music-lgin-alls">
                    <div class="music-lgin-eyeleft">
                        <div class="music-left-eyeball yeball-l"></div>
                    </div>
                    <div class="music-lgin-eyeright">
                        <div class="music-right-eyeball yeball-r"></div>
                    </div>
                    <div class="music-lgin-cl"></div>
                </div>
                <!--鼻子-->
                <div class="music-nose"></div>
                <!--嘴-->
                <div class="music-mouth music-mouth-ds"></div>
                <!--肩-->
                <div class="music-shoulder-l">
                    <div class="music-shoulder"></div>
                </div>
                <div class="music-shoulder-r">
                    <div class="music-shoulder"></div>
                </div>
                <!--消息框-->
                <div class="music-news"><?php echo $error; ?></div>
            </div>

            <!--右手-->
            <div class="music-lgin-right ovhd">
                <div class="music-hand">
                    <div class="music-lgin-hara"></div>
                    <div class="music-lgin-hars"></div>
                </div>
            </div>

        </div>
        <form action="login.php" method="post">
        <!--1-->
        <div class="music-lgin-text" style="margin-top: 80px;">
            <input class="inputname inputs" type="text" name="xuehao" placeholder="亲，请绑定学号" />
        </div>
        <!--3-->
        <div class="music-lgin-text">
            <input class="music-qd inputs" type="submit" value="确定" />
        </div>
        </form>
    </div>

    <script src="js/jquery-1.9.1.min.js"></script>
    <script type="text/javascript">
        //眼睛 密码部分
        $(".mima").focus(function() {
            $(".music-lgin-left").addClass("left-dh").removeClass("rmleft-dh");
            $(".music-lgin-right").addClass("right-dh").removeClass("right-rmdh");
            $(".music-hand").addClass("no");
        }).blur(function() {
            $(".music-lgin-left").removeClass("left-dh").addClass("rmleft-dh");
            $(".music-lgin-right").removeClass("right-dh").addClass("right-rmdh");
            $(".music-hand").removeClass("no");

        })

    </script>

</body>

</html>